This tutorial was modified from lab 4 of the SlicerMorph workshop. For more infomration on measurments and visualizations in SlicerMorph see the full workhop: https://github.com/SlicerMorph/W_2020
IMPORTANT: Before you start any markups make sure your volume spacing is correct in the volumes module!
ROI: Place two points sequentially that specify corners of a rectangular cube defining the region of interest. The size and shape of the rectangle can be adjusted after placement.
Fiducials: Place a single landmark point.
Lines: Sequentially place two points, creating a line between them.
Angles: Place three points sequentially. This forms two vectors where the second point placed is the vertex. The angle beween the two vectors is displayed.
Open and closed curves: Sequentially place points. A curve will be fit to the points and updated as additional points are added. If the closed curve is selected, the first and last points placed will be connected.
Fiducial points and anchor points of lines, curves, and angles can be accessed and manipulated using the Markups module.
In this example, we will place a closed curve on one slice of a CT scan, measure the area of the curve, and visualize the region. For more detail and discussion, see the Slicer discourse thread here.
If you would like to follow along I’m working off of the MRIHead volume in the Sample Data module.
Select the closed curve markup mode and place a curve around the brain tissue in the red view window (axial slice). You can change the Slicer layout to red window only for better detail. When placing the curve click as many times as you need to in order to get your desigred shape. One really handy tool in the Markups modlue is the resample cuve tool which will allow you to resample your curve with a given number of equally spaced points.
curve=slicer.util.getNodesByClass("vtkMRMLMarkupsClosedCurveNode")[0]
crossSectionSurface = vtk.vtkPolyData()
areaMm2 = slicer.modules.markups.logic().GetClosedCurveSurfaceArea(curve, crossSectionSurface)
print("Curve {0}: surface area = {1:.2f} mm2".format(curve.GetName(), areaMm2))
crossSectionSurfaceModel = slicer.modules.models.logic().AddModel(crossSectionSurface)
crossSectionSurfaceModel.SetName("{0} surface".format(curve.GetName()))
crossSectionSurfaceModel.CreateDefaultDisplayNodes()
crossSectionSurfaceModel.GetDisplayNode().BackfaceCullingOff()
crossSectionSurfaceModel.GetDisplayNode().SetColor(curve.GetDisplayNode().GetColor())
crossSectionSurfaceModel.GetDisplayNode().SetOpacity(0.5)
crossSectionSurfaceModel.SetDescription("Area[mm2] = {0:.2f}".format(areaMm2))
Mesh data in Slicer is displayed using the Models Module. It can not be rendered using the Volume Render module. Fiducial points are automatically placed on the surface of the a loaded mesh and will be constrained to the surface when they are moved. The control points for other markups are also constrained to mesh surfaces when present.
Sample Data module (you will need SLicerMorph installed to see this option in the menu).2.Center the dataset in the 3D viewing window using the button at the top left of the window. Optionally, change to the 3D only layout.
Open the Models module. Experiment with changing the color and opacity of the skull.
Select open curve placement mode from the upper menu bar and place a curve between landmarks 35 and 42 using approximately 10 points. Note that the control points are snapped to the mesh, but the curve itself may lie above or below the mesh surface.
Open the Markups module. Expand the Resample Menu. Select Create a new markups curve from the Output node selector and set the number of resampled points to 50. In the Constrain points to surface menu, select the loaded gorilla mesh. Before resampling, confirm that the curve to be resampled is selected as the active node in the Markups table.
Click the Resample curve button to generate a new open curve with 50 points constrained to the mesh surface. This results in a curve that is closer to the actual surface curvature than the original. Note any difference in length between the original and resampled curves reported in the Markups table.
The Volume Rendering module provides interactive visualization of 3D image data. For full documentation of the panel and functions, see here. * Only scalar volumes can be used for volume rendering. Vector volumes (eg jpg, png, bmp, or other classic 2D formats) can be converted to scalar volumes using the VectorToScalarVolume module. * 3D Slicer uses volume ray casting to computes 2D images from 3D volumetric data sets. Unlike surface reconstruction, there is no estimation of object surfaces or segmentation. * The values displayed are calculated using a transfer function that incorporates voxel intensities, material properties, and illumination. * The opacity and color of the image can be adjusted by modifying their transfer functions in the Volume Rendering module.
Sample Data module.Volume Rendering module. In the Volume field, make sure the volume MRHead is selected. Click the eyeball next to the Volume field to display the image. You can change the 3D Slicer layout to 3D only.Expand the Advanced tab to view the opacity and color transfer functions. You can click on these functions to move or add additional control points.
Under the Display tab, click on the Select a Preset menu. This menu contains saved transfer functions that work well for common data types. Select MRI Default (row 4, column 5). Try adjusting the color and opacity functions of this suggested display setting.